翻訳と辞書
Words near each other
・ Pattern (architecture)
・ Pattern (casting)
・ Pattern (devotional)
・ Pattern (disambiguation)
・ Pattern (Schulze)
・ Pattern (sewing)
・ Pattern 1796 light cavalry sabre
・ Pattern 1853 Enfield
・ Pattern 1861 Enfield musketoon
・ Pattern 1908 and 1912 cavalry swords
・ Pattern 1913 Enfield
・ Pattern 1914 Enfield
・ Pattern and Decoration
・ Pattern bargaining
・ Pattern block
Pattern calculus
・ Pattern coin
・ Pattern completion
・ Pattern day trader
・ Pattern detection
・ Pattern directed invocation programming language
・ Pattern for Conquest
・ Pattern formation
・ Pattern gardening
・ Pattern grading
・ Pattern grammar
・ Pattern Is Movement
・ Pattern language
・ Pattern language (disambiguation)
・ Pattern language (formal languages)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Pattern calculus : ウィキペディア英語版
Pattern calculus
Pattern calculus bases all computation on pattern matching of a very general kind. Like lambda calculus, it supports a
uniform treatment of function evaluation. Also, it allows functions to be
passed as arguments and returned as results. In addition, pattern calculus supports
uniform access to the internal structure of arguments, be they pairs
or lists or trees. Also, it allows patterns to be passed as arguments and
returned as results. Uniform access is illustrated by a
pattern-matching function size that computes the size of an
arbitrary data structure. In the notation of the programming language
bondi, it is given by the recursive function
let rec size =
| x y -> (size x) + (size y)
| x -> 1

The second, or ''default case'' x -> 1 matches the pattern x
against the argument and returns 1. This
case is used only if the matching failed in the first case. The
first, or ''special case'' matches against any ''compound'', such
as a non-empty list, or pair. Matching binds x to the left component
and y to the right component. Then the body of the case adds the
sizes of these components together.
Similar techniques yield generic queries for searching and updating. Combining recursion and decomposition in this way yields ''path polymorphism''.
The ability to pass patterns as parameters (''pattern polymorphism'') is illustrated by defining a
generic eliminator. Suppose given constructors Leaf for creating
the leaves of a tree, and Count for converting numbers into
counters. The corresponding eliminators are then

elimLeaf = | Leaf y -> y
elimCount = | Count y -> y

For example, elimLeaf (Leaf 3) evaluates to 3 as does elimCount (Count 3).
These examples can be produced by applying the generic eliminator
elim to the constructors in question. It is defined by

elim = | x -> | x y -> y

Now elim Leaf evaluates to | Leaf y -> y which is equivalent to elimLeaf. Also elim Count is equivalent to elimCount.
In general, the curly braces {} contain the bound variables of the
pattern, so that x is free and y is bound in | {y} x y -> y.
==External links==

*(the original paper, but not most general )
*(pure pattern calculus )
*(Monograph on pattern calculus: pure, typed and implemented in bondi )
*(Monograph on pattern calculus: download )
*(bondi programming language research site )
*(concurrent pattern calculus )

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Pattern calculus」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.